<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 transitional//EN">
<html>
<head>
<title>Script Data Source Element</title>
<link rel="stylesheet" href="../style/style.css" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>ScriptDataSource</h1>

<p>A specialized data source defined in JavaScript.</p>

<h3>Description</h3>

<p>A scripted data source is one that is defined in 
JavaScript. The actual implementation can also be in Java, with a JavaScript 
wrapper. The application is responsible for implementing two operations:</p>

<ul>
<li>Open: connect to the external data source. Report an error if the connection fails.</li>
<li>Close: release the connection to the external data source.</li>
</ul>

<p>A scripted data source may use user-defined properties to 
define connection-specific properties. Doing so allows the developer to put the 
data source into a library, and use it in many reports. For example, the 
developer may define a SOAP data source with properties for the server name, 
port number and so on. The scripts associated with the data source use the ROM 
scripting objects to access the value of these custom properties.</p>

<h3>See Also</h3>

<p><code>ScriptDataSet element</code></p>

<p><code>DataSource</code> scripting object</p>

<h2 class="method">open</h2>

<p>Establishes a connection to the external data source.</p>

<h3>Description</h3>

<p>Called by BIRT to establish a connection to the data 
source. Throws a JavaScript exception if the connection fails.</p>

<h3>See Also</h3>
<p><code>beforeOpen</code> method</p>
<p><code>afterOpen</code> method</p>

<h2 class="method">close</h2>

<p>Releases the connection to the external data source.</p>

<h3>Description</h3>

<p>Called when BIRT wishes to close the data source. Should 
release the connection to the external data source.</p>

<h3>See Also</h3>
<p><code>beforeClose</code> method</p>
<p><code>afterClose</code> method</p>

</body>
</html>